package cn.iocoder.yudao.module.hs.dal.mysql.qcorderdetail;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.hs.dal.dataobject.qcorderdetail.QcOrderDetailDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.hs.controller.admin.qcorderdetail.vo.*;

/**
 * 质检单明细 Mapper
 *
 * @author 航盛
 */
@Mapper
public interface QcOrderDetailMapper extends BaseMapperX<QcOrderDetailDO> {

    default PageResult<QcOrderDetailDO> selectPage(QcOrderDetailPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<QcOrderDetailDO>()
                .eqIfPresent(QcOrderDetailDO::getQcOrderId, reqVO.getQcOrderId())
                .likeIfPresent(QcOrderDetailDO::getInfoCode, reqVO.getInfoCode())
                .likeIfPresent(QcOrderDetailDO::getBoxCode, reqVO.getBoxCode())
                .likeIfPresent(QcOrderDetailDO::getMaterialName, reqVO.getMaterialName())
                .likeIfPresent(QcOrderDetailDO::getMaterialCode, reqVO.getMaterialCode())
                .likeIfPresent(QcOrderDetailDO::getMaterialModeCode, reqVO.getMaterialModeCode())
                .eqIfPresent(QcOrderDetailDO::getQcResult, reqVO.getQcResult())
                .eqIfPresent(QcOrderDetailDO::getIsEntry, reqVO.getIsEntry())
                .betweenIfPresent(QcOrderDetailDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(QcOrderDetailDO::getId));
    }

}